<template>
  <!-- 首页顶部导航组件 -->
  <div class="home-nav">
    <!-- logo 区域 -->
    <img height="20" src="@/assets/logo.png" alt="logo">

    <!-- 搜索区域 -->
    <div class="search">
      <van-icon name="search" size="0.5rem" />
    </div>

    <!-- 分类按钮 -->
    <van-icon name="wap-nav" size="0.5rem" />
  </div>
</template>

<script setup>
// 导入 vant 组件，按需引入
import {
  Icon as VanIcon
} from 'vant'
</script>

<style lang="scss" scoped>
// 首页顶部导航组件样式
.home-nav {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  padding: 0 5px;
  background-color: #fff;

  // logo 图片样式
  img {
    margin-right: 5px;
  }

  // 搜索区域样式
  .search {
    width: 100%;
    margin-right: 5px;
    padding: 0 5px;
    background-color: #f7f7f7;
    border-radius: 20px;
    text-align: right;
  }
}
</style>
